import request from '@renderer/server/index'

// 发送消息
export const sendMsgApi = (message: any) => {
  return request.post({
    url: '/chat/send',
    data: {
      to_id: message.to_id,
      chat_type: message.chat_type,
      type: message.type,
      data: message.data,
      options: JSON.stringify(message.options)
    }
  })
}

// 获得离线消息
export const getOfflineMsgApi = () => {
  return request.get({
    url: '/chat/offine'
  })
}

// 文件上传
export const uploadFileApi = (files: any) => {
  return request.post({
    url: '/upload',
    data: files
  })
}
